import {mapGetters} from 'vuex'
export default {
	computed:{
		...mapGetters('my_cart',['total'])
	},
	watch:{
		total(val){
			this.getBadge(val)
		}
	},
	onShow(){
		this.getBadge()
	},
	methods:{
		getBadge(total=this.total){
			uni.setTabBarBadge({
				index:2,
				text:total + ''
			})
		}
	}
}